package com.yuchen.ishop;

import com.yuchen.core.MyPager;
import org.apache.commons.lang.math.NumberUtils;

import java.util.Map;

/**
 *
 */
public class MyPagerUtils {

    public static MyPager myPager(Map params){
        MyPager myPager = new MyPager();
        if (params != null && params.size() > 0) {
            if (params.get("pageSize") != null) {
                myPager.setPageSize(NumberUtils.toInt(params.get("pageSize").toString()));
            }
            if (params.get("pageNo") != null) {

                myPager.setPageNo( NumberUtils.toInt(params.get("pageNo").toString()));
            }
        }
        return myPager;
    }
}
